﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Backend/Backend.Master" Inherits="System.Web.Mvc.ViewPage<IntroduceCompany.ProductListView>" %>
<%@Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor"%>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	ProductEdit
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<script type="text/javascript" src="<%= Url.Content("../../../Content/Backend/js/ckeditor/ckeditor.js")%>"></script>
<!-- Begin one column tab content window -->
    <div class="onecolumn">
        <div class="header">
            <span>Chỉnh Sửa Sản Phẩm</span>
            <div class="switchbutton">
                <a href="<%= Url.Action("ProductImageList","Product", new { productID = Model.ProductID}) %>" class="button">Album</a>
                <a href="<%= Url.Action("ProductCreate", "Product") %>" class="button">Thêm mới</a>
                <a href="<%= Url.Action("ProductListBackend", "Product") %>" class="button">Danh sách</a>
            </div>
        </div>
        <br class="clear" />
        <div class="content">
            
            <div class="display-label error">
                <div class="errorcontent">
                    <p><%= Html.ValidationMessage("NoticePage")%></p>
                    <p><%= Html.ValidationMessageFor(model => model.ProductName) %></p>
                    <p><%= Html.ValidationMessageFor(model => model.ProductPrice) %></p>
                    <p><%= Html.ValidationMessageFor(model => model.ProductDescription) %></p>
                </div>
            </div>
            <!--image product here-->
            <img src="../../../Image/Product/thumbnail/<%=Html.Action("GetOneProductImage", "Product", new {productID= Model.ProductID})%>" 
            alt="<%= Model.ProductName %>" title="<%= Model.ProductName %>" class="img_h170" style="height:150px;"/>
            <% using (Html.BeginForm("ProductEdit", "Product"))
               {%>
            <div>
                <div class="editor_left">
                    <label>
                        Ngôn ngữ:</label><br />
                    <%= Html.DropDownList("ProductLanguageID", (SelectList)ViewData["LaguageList"], new { @style = "width:300px;", onchange = "this.form.submit();" })%>
                    <%= Html.HiddenFor(model => model.ProductID) %>
                </div>
            </div>
            <%} %>
            <% using (Html.BeginForm("ProductEditSubmit", "Product", FormMethod.Post, new { enctype = "multipart/form-data" }))
               {%>
                <%= Html.AntiForgeryToken(IntroduceCompany.Util.AntiKey.EditSalt)%>
                <%= Html.ValidationSummary(true) %>    
                
                <div>
                    <div class="editor_middle">
                        <label>Loại sản phẩm:</label><br />
                        <%= Html.DropDownListFor(model => model.ProductTypeID, ViewData["DDLProductType"] as SelectList, new { @style = "width:300px;" })%>
                    </div>
                </div><br class="clear"/><br />
                <div>
                    <div class="editor_left">
                        <label>Tên sản phẩm:</label><br />
                        <%= Html.TextBoxFor(model => model.ProductName, new { maxlength = "100" })%>
                    </div>
                    <div class="editor_middle">
                        <div class="editor_fl">
                            <label>Giá sản phẩm: (VND)</label><br />
                            <%= Html.TextBoxFor(model => model.ProductPrice, new {Maxlength = "11" , @style="width:123px;" })%>
                        </div> 
                        <div class="editor_fr">
                            <label>Trạng thái:</label><br />
                            <%= Html.DropDownListFor(model => model.ProductStatusID, ViewData["DDLProductStatus"] as SelectList, new { @style = "width:135px;" })%>
                        </div> 
                    </div>
                </div><br class="clear"/><br />
                <div>
                    <div class="editor_left">
                        <label>Mã sản phẩm:</label>
                        <%= Model.ProductID %>
                    </div> 
                     <div class="editor_middle">
                        <label>Lượt xem:</label>
                        <%=  Model.ViewNumber%>
                    </div>
                </div><br class="clear"/><br />
                <div>
                    <div class="editor_left">
                        <label>Ngày tạo sản phẩm:</label>
                        <%= IntroduceCompany.Util.GeneralClass.ConvertDate_1B(Model.CreateDate)%>
                    </div>   
                    <div class="editor_middle width_middle">
                        <label>Ngày chỉnh sửa cuối:</label>
                        <%= IntroduceCompany.Util.GeneralClass.ConvertDate_1B(Model.UpdateDate)%>
                    </div>
                    <div class="editor_right">
                        <label>Người chỉnh sửa cuối:</label>
                        <%= Model.FullName%>
                    </div>
                </div><br class="clear"/><br />
                <div>
                    <label>Mô tả sản phẩm:</label><br />
                    <%= Html.TextAreaFor(model => model.ProductDescription, new { @class = "ckeditor" })%>
                </div><br class="clear"/>

            <%= Html.HiddenFor(model => model.ProductID) %>
            <%= Html.HiddenFor(model => model.ProductLanguageID) %>
            <p>
                <input type="submit" value="Cập Nhật" />
                <a href="<%= Url.Action("ProductEdit","Product", new { productID = Model.ProductID, productLanguageID = Model.ProductLanguageID }) %>"  class="buttonform">Làm Lại</a>
            </p><br class="clear"/>
            
            <script type="text/javascript">
                CKEDITOR.replace('ProductDescription', {
                    BasePath: '../../../Content/Backend/js/ckeditor/',
                    customConfig: 'CustomAdmin.js'
                });
	    </script>
    <% } %>

        </div>
    </div>
<!-- End one column tab content window -->
</asp:Content>

